package net.sx.minemodule.mvp.presenters;

import com.kedll.library.mvp.BasePresenter;

import net.sx.minemodule.mvp.bean.TestIntegralBean;
import net.sx.minemodule.mvp.views.MineIntegralView;

import io.reactivex.Observable;

/**
 * 我的大洋
 * @author 11470
 */
public class MineIntegralPresenter extends BasePresenter<MineIntegralView> {

    public MineIntegralPresenter(MineIntegralView view) {
        super(view);
    }

    public void addTestData() {

        //在这里创建数据
        addSubscription(Observable.range(0, 5)
                .map(integer -> {
                    TestIntegralBean bean = new TestIntegralBean();
                  bean.setIntegralNum(integer);
                  bean.setMoney(integer);
                    return bean;
                })
                .toList()
                .subscribe(beanList -> mView.addData(beanList)));
    }

}
